package datastructure.graph.最短路径;

/**
 * @author MaoLin Wang
 * @description
 * @date 2020/8/28 1:16 下午
 */
public class DirectedEdge {
    public int from;
    public int to;
    public double weight;

    public DirectedEdge(int from, int to, double weight) {
        this.from = from;
        this.to = to;
        this.weight = weight;
    }

    public int from() {
        return from;
    }

    public void setFrom(int from) {
        this.from = from;
    }

    public int to() {
        return to;
    }

    public void setTo(int to) {
        this.to = to;
    }

    public double weight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    @Override
    public String toString() {
        return String.format("%d->%d %.2f",from,to,weight);
    }


}
